import request from '@/utils/request'
// role-获取部门信息
export function getDepts(params) {
  return request({
    url: 'dept/list',
    method: 'get',
    params
  })
}
// dept-子节点获取
export function getDeptTree(pid) {
  return request({
    url: 'dept/lazy?pid=' + pid,
    method: 'get'
  })
}
// dept-上级菜单获取
export function getDeptSuperior(id) {
  return request({
    url: 'dept/superior?id=' + id,
    method: 'get'
  })
}
// dept-增
export function create(data) {
  return request({
    url: 'dept',
    method: 'post',
    data
  })
}
// dept-删
export function del(ids) {
  return request({
    url: 'dept',
    method: 'delete',
    data: ids
  })
}
// dept-改
export function update(data) {
  return request({
    url: 'dept',
    method: 'put',
    data
  })
}

export default { create, update, del, getDepts, getDeptTree, getDeptSuperior }
